package com.sxhuayuan.parking.plugin.parking.dao_er.request;

import com.sxhuayuan.parking.exception.SystemException;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;

/**
 * 通知车场缴费成功
 * 
 * @author 何龙
 * @date 2019-07-15 12:01
 */
public class DaoerOrderSuccessNotifyRequestData extends DaoerBaseRequest {

	/** 车牌号 */
	private String carNo;

	/** 卡编号 */
	private String cardId;

	/** 卡号 */
	private String cardNo;

	/** 入场时间 格式 yyyy-MM-dd HH:mm:ss */
	@NotNull
	private String entryTime;

	/** 缴费时间 格式 yyyy-MM-dd HH:mm:ss */
	@NotNull
	private String payTime;

	/** 计费时长 单位：分钟 */
	@NotNull
	private String chargeDuration;
	/** 应收金额 单位：元 */
	@NotNull
	private String amount;

	/** 实收金额 单位：元 */
	@NotNull
	private String purchaseAmount;

	/** 优惠金额 单位：元 */
	@NotNull
	private String couponAmount;

	/** 支付方式 0:现金 1:微信 2:支付宝 3:银联闪付 4:交通卡 */
	@NotNull
	private Integer paymentType;

	/** 支付流水号 注：全局唯一 */
	@NotNull
	private String paymentTnx;

	/** 付款记录生成用户 */
	@NotNull
	private String operator;

	/** 出入口编号 ，当缴费为出口扫码缴费时，请添加通道编号 */
	private String channelId;

	@Override
	public String requestUrl() {
		return "/v2/car/temporarycar/payment/parkid";
	}

	@Override
	public RequestMethod getRequestMethod() {
		return RequestMethod.POST;
	}

	@Override
	protected void checkConstraints() throws SystemException {
		if (StringUtils.isEmpty(cardNo)&&StringUtils.isEmpty(cardId)&&StringUtils.isEmpty(carNo)){
			throw new SystemException("车牌号、卡编号、卡号至少有一个值");
		}
	}

	public String getCarNo() {
		return carNo;
	}

	public void setCarNo(String carNo) {
		this.carNo = carNo;
	}

	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getEntryTime() {
		return entryTime;
	}

	public void setEntryTime(String entryTime) {
		this.entryTime = entryTime;
	}

	public String getPayTime() {
		return payTime;
	}

	public void setPayTime(String payTime) {
		this.payTime = payTime;
	}

	public String getChargeDuration() {
		return chargeDuration;
	}

	public void setChargeDuration(String chargeDuration) {
		this.chargeDuration = chargeDuration;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getPurchaseAmount() {
		return purchaseAmount;
	}

	public void setPurchaseAmount(String purchaseAmount) {
		this.purchaseAmount = purchaseAmount;
	}

	public String getCouponAmount() {
		return couponAmount;
	}

	public void setCouponAmount(String couponAmount) {
		this.couponAmount = couponAmount;
	}

	public Integer getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(Integer paymentType) {
		this.paymentType = paymentType;
	}

	public String getPaymentTnx() {
		return paymentTnx;
	}

	public void setPaymentTnx(String paymentTnx) {
		this.paymentTnx = paymentTnx;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public String getChannelId() {
		return channelId;
	}

	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}
}
